//
//  DataModel.swift
//  letuofu
//
//  Created by WH-JS on 2019/12/17.
//  Copyright © 2019 WH-JS. All rights reserved.
//

import UIKit

class DataModel: NSObject {

}

//    标识结构
//    RootClass.swift
//    Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport

import Foundation

struct ZoneCodeModel{

    var code : String!
    var name : String!
    var sort : Int!


    /**
     * Instantiate the instance using the passed dictionary values to set the properties values
     */
    init(fromDictionary dictionary: [String:Any?]){
        code = dictionary["code"] as? String
        name = dictionary["name"] as? String
        sort = dictionary["sort"] as? Int
    }

    /**
     * Returns all the available property values in the form of [String:Any?] object where the key is the approperiate json key and the value is the value of the corresponding property
     */
    func toDictionary() -> [String:Any?]
    {
        var dictionary = [String:Any?]()
        if code != nil{
            dictionary["code"] = code
        }
        if name != nil{
            dictionary["name"] = name
        }
        if sort != nil{
            dictionary["sort"] = sort
        }
        return dictionary
    }

}

//
//    RootClass.swift
//    Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport

import Foundation

struct OrderDataClass{

    var identityToken : String!
    var items : [OrderItem]!
    var orderDeliverModeCode : String!
    var orderDeliverSiteCode : String!
    var remark : String!
    var zoneCode : String!


    /**
     * Instantiate the instance using the passed dictionary values to set the properties values
     */
    init(fromDictionary dictionary: [String:Any]){
        identityToken = dictionary["identityToken"] as? String
        items = [OrderItem]()
        if let itemsArray = dictionary["items"] as? [[String:Any]]{
            for dic in itemsArray{
                let value = OrderItem(fromDictionary: dic)
                items.append(value)
            }
        }
        orderDeliverModeCode = dictionary["orderDeliverModeCode"] as? String
        orderDeliverSiteCode = dictionary["orderDeliverSiteCode"] as? String
        remark = dictionary["remark"] as? String
        zoneCode = dictionary["zoneCode"] as? String
    }

    /**
     * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
     */
    func toDictionary() -> [String:Any]
    {
        var dictionary = [String:Any]()
        if identityToken != nil{
            dictionary["identityToken"] = identityToken
        }
        if items != nil{
            var dictionaryElements = [[String:Any]]()
            for itemsElement in items {
                dictionaryElements.append(itemsElement.toDictionary())
            }
            dictionary["items"] = dictionaryElements
        }
        if orderDeliverModeCode != nil{
            dictionary["orderDeliverModeCode"] = orderDeliverModeCode
        }
        if orderDeliverSiteCode != nil{
            dictionary["orderDeliverSiteCode"] = orderDeliverSiteCode
        }
        if remark != nil{
            dictionary["remark"] = remark
        }
        if zoneCode != nil{
            dictionary["zoneCode"] = zoneCode
        }
        return dictionary
    }

}

//
//    Item.swift
//    Model file generated using JSONExport: https://github.com/Ahmed-Ali/JSONExport

struct OrderItem{

    var cartID : String!


    /**
     * Instantiate the instance using the passed dictionary values to set the properties values
     */
    init(fromDictionary dictionary: [String:Any]){
        cartID = dictionary["cartID"] as? String
    }

    /**
     * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
     */
    func toDictionary() -> [String:Any]
    {
        var dictionary = [String:Any]()
        if cartID != nil{
            dictionary["cartID"] = cartID
        }
        return dictionary
    }

}
